import { Commit } from "vuex"
import {pageRoutes} from '/@/router/page/index'
const state: any = {
    routes: [],
}

const getters: any = {
    routes: (state: any) => state.routes
}

const mutations: any = {
    setRoutes(state: any, routes: object) {
        state.routes = routes
    }
}

const actions: any = {
    async setRoutes(context: {commit: Commit}) {
        const finallyRoutes = [...pageRoutes]
        console.log("finallyRoutes: ", finallyRoutes)
        context.commit("setRoutes", finallyRoutes)
    }
}

export default {state, getters, mutations, actions}